import com.powerfl.frm.taf.*;

final public function template( $template:String, ...$variables ):String{
	return template_( $template, $variables );
}
private function template_( $template:String, $variables:Array ):String{
	var i:int, j:int;
	if( tdata( '@TEMPLATE' )[$template] ){
		$template = tdata( '@TEMPLATE' )[$template];
	}
	for( i = 0, j = $variables.length ; i < j ; ++i ){
		$template = $template.replace( '@@' + i.toString(), $variables[i] );
	}
	return $template;
}